home *** CD-ROM | disk | FTP | other *** search
- /* TRANS.C
-
- Copyright (c) 1984, Gordon Lee Waite
- 413 W. Pleasant Street
- Maquoketa, IA 52060
-
- summary: trans string1 string2 infile outfile
-
- arguments: string1 contains the target characters which are
- searched for in the text.
-
- string2 contains the characters which will be
- substituted for their counterparts in string1.
-
- infile is the name of the input file.
-
- outfile is the name of the output file.
-
- options: none
-
- description:
-
- TRANS processes an ASCII text file, substituting the characters
- in string STRING2 for the characters in string1. The two
- strings must be of equal length. The output from this program
- is written to OUTFILE. The user should not surround the
- two strings with quotes.
-
- NOTE: This is a character-by-character replacement, not
- a global string replacement. Every occurance of
- each letter in string1 will change to its counterpart
- in string2!
-
-
- example:
- trans /@ sa x1 x2
- This would use x1 for the source file and change all '/' and '@'
- characters to 's' and 'a' respectively. The resulting text is
- written to x2.
-
- note:
-
- REDUCE is applied to both arguments, so you can write unprintable
- characters using '\' as a special marker. For example, to
- change all tabs to blanks, use the following command:
-
- trans \t \x32 infile outfile
-
- REDUCE understands the following special cases:
-
- \t TAB
- \n NEWLINE
- \xHH HEXADECIMAL BYTE
- \0 NULL BYTE
- */
-